package org.dromara.business.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.business.domain.Goods;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.mybatis.core.domain.BaseEntity;

import java.math.BigDecimal;

/**
 * 商城商品业务对象 goods
 *
 * @author Lion Li
 * @date 2025-05-18
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = Goods.class, reverseConvertGenerate = false)
public class GoodsBo extends BaseEntity {

    /**
     * 商品编号
     */
    @NotNull(message = "商品编号不能为空", groups = {EditGroup.class})
    private Long goodsId;

    /**
     * 商品名称
     */
    @NotBlank(message = "商品名称不能为空", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 商品图片id
     */
    @NotBlank(message = "商品图片id不能为空", groups = {AddGroup.class, EditGroup.class})
    private String url;

    /**
     * 商品价格
     */
    @NotNull(message = "商品价格不能为空", groups = {AddGroup.class, EditGroup.class})
    private BigDecimal price;

    /**
     * 状态（0正常 1停用）
     */
    @NotBlank(message = "状态（0正常 1停用）不能为空", groups = {AddGroup.class, EditGroup.class})
    private String status;

    /**
     * 商品介绍
     */
    @NotBlank(message = "商品介绍不能为空", groups = {AddGroup.class, EditGroup.class})
    private String info;

    /**
     * 详情
     */
    @NotBlank(message = "详情不能为空", groups = {AddGroup.class, EditGroup.class})
    private String infoDesc;

    /**
     * 销量
     */
    @NotNull(message = "销量不能为空", groups = {AddGroup.class, EditGroup.class})
    private Integer num;

    //限购数量
    private Integer buyLimit;

    /**
     * 分类
     */
    @NotNull(message = "分类不能为空", groups = {AddGroup.class, EditGroup.class})
    private String type;
    @NotNull(message = "分类不能为空", groups = {AddGroup.class, EditGroup.class})
    private String oneType;
    @NotNull(message = "分类不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long oneTypeId;

    //  游戏区服 - 线隔开
    private String gameArea;

}
